package com.example.aspect.achieve;

import com.example.service.RedisService;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class MyBean implements DisposableBean {
    @Resource
    RedisService service;

    @Override
    public void destroy() throws Exception {
        System.out.println(service);
        service.deleteAll();
    }
}
